package spring.chatroom.java_chatroom.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import spring.chatroom.java_chatroom.controller.pojo.SetBackground;
import spring.chatroom.java_chatroom.controller.pojo.SetEmail;
import spring.chatroom.java_chatroom.controller.pojo.SetPassword;
import spring.chatroom.java_chatroom.controller.pojo.SettingUserInfo;
import spring.chatroom.java_chatroom.pojo.model.UserInfo;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<UserInfo> {

    //获取用户信息
    List<UserInfo> selectAllUsers();

    UserInfo selectUsersByNameAndPassWord(UserInfo UserInfo);

    UserInfo selectUsersById(Integer id);

    //保存用户信息
    int insertUsers(UserInfo UserInfo);

    UserInfo getUserByUserId(Integer userId);

    Integer modifyUserInfo(SettingUserInfo userInfo);

    Integer modifyPassword(SetPassword setPassword);


    void modifyEmail(SetEmail request);

    Integer getUserByUserIdAndEmail(Integer userId, String email);

    UserInfo getUserInfoByEmail(String email);

    Integer modifyBackGround(SetBackground request);
}
